package org.darkforest.model;

import java.math.BigDecimal;

import org.darkforest.common.util.DateUtil;
import org.darkforest.enums.SellerStateEnum;
import org.darkforest.common.util.SerialNumGenerator;

public class RefundReturn {
    private Integer refundId;

    private Integer orderId;

    private String orderSn;

    private String refundSn;

    private Integer storeId;

    private String storeName;

    private Integer buyerId;

    private String buyerName;

    private Integer goodsId;

    private Integer orderGoodsId;

    private String goodsName;

    private Integer goodsNum;

    private BigDecimal orderAmount; //订单总金额

    private BigDecimal refundAmount; //退款金额

    private String goodsImage;

    private Integer orderGoodsType;

    private Integer refundType;

    private Integer sellerState;

    private Integer refundState;

    private Integer returnType;

    private Integer orderLock;

    private Integer goodsState;

    private Integer addTime;

    private String addTimeStr;

    private Integer sellerTime;

    private Integer adminTime;

    private Integer reasonId;

    private String reasonInfo;

    private String picInfo;

    private String buyerMessage;

    private String sellerMessage;

    private String adminMessage;

    private Integer expressId;

    private String invoiceNo;

    private Integer shipTime;

    private Integer delayTime;

    private Integer receiveTime;

    private String receiveMessage;

    private Short commisRate;

    private String sellerTimeStr;

    private String shipTimeStr;

    public String getShipTimeStr() {
        return DateUtil.toIntDateString(this.getShipTime());
    }

    public void setShipTimeStr(String shipTimeStr) {
        this.shipTimeStr = shipTimeStr;
    }

    public String getSellerTimeStr() {
        return DateUtil.toIntDateString(this.getSellerTime());
    }

    public void setSellerTimeStr(String sellerTimeStr) {
        this.sellerTimeStr = sellerTimeStr;
    }

    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }

    private String returnChannel; //退款渠道 1微信  2支付宝 3余额支付 4余额加微信支付 5余额加支付宝。

    public String getReturnChannel() {
        return returnChannel;
    }

    public String getReturnChannelStr() {
        if(returnChannel.equals("5"))
            return "余额和支付宝";
        if (returnChannel.equals("1"))
            return "微信";
        else if (returnChannel.equals("2"))
            return "支付宝";
        else if (returnChannel.equals("3"))
            return "余额支付";
        else if (returnChannel.equals("4"))
            return "余额和微信";
        else
            return "";
    }

    public void setReturnChannel(String returnChannel) {
        this.returnChannel = returnChannel;
    }

    public Integer getRefundId() {
        return refundId;
    }

    public void setRefundId(Integer refundId) {
        this.refundId = refundId;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn == null ? null : orderSn.trim();
    }

    public String getRefundSn() {
        return refundSn;
    }

    public void setRefundSn(String refundSn) {
        this.refundSn = refundSn == null ? null : refundSn.trim();
    }

    public Integer getStoreId() {
        return storeId;
    }

    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName == null ? null : storeName.trim();
    }

    public Integer getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(Integer buyerId) {
        this.buyerId = buyerId;
    }

    public String getBuyerName() {
        return buyerName;
    }

    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName == null ? null : buyerName.trim();
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getOrderGoodsId() {
        return orderGoodsId;
    }

    public void setOrderGoodsId(Integer orderGoodsId) {
        this.orderGoodsId = orderGoodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName == null ? null : goodsName.trim();
    }

    public Integer getGoodsNum() {
        return goodsNum;
    }

    public void setGoodsNum(Integer goodsNum) {
        this.goodsNum = goodsNum;
    }

    public BigDecimal getRefundAmount() {
        return refundAmount;
    }

    public void setRefundAmount(BigDecimal refundAmount) {
        this.refundAmount = refundAmount;
    }

    public String getGoodsImage() {
        return goodsImage;
    }

    public void setGoodsImage(String goodsImage) {
        this.goodsImage = goodsImage == null ? null : goodsImage.trim();
    }

    public Integer getOrderGoodsType() {
        return orderGoodsType;
    }

    public void setOrderGoodsType(Integer orderGoodsType) {
        this.orderGoodsType = orderGoodsType;
    }

    public Integer getRefundType() {
        return refundType;
    }

    public void setRefundType(Integer refundType) {
        this.refundType = refundType;
    }

    public Integer getSellerState() {
        return sellerState;
    }

    public void setSellerState(Integer sellerState) {
        this.sellerState = sellerState;
    }

    public Integer getRefundState() {
        return refundState;
    }

    public void setRefundState(Integer refundState) {
        this.refundState = refundState;
    }

    public Integer getReturnType() {
        return returnType;
    }

    public void setReturnType(Integer returnType) {
        this.returnType = returnType;
    }

    public Integer getOrderLock() {
        return orderLock;
    }

    public void setOrderLock(Integer orderLock) {
        this.orderLock = orderLock;
    }

    public Integer getGoodsState() {
        return goodsState;
    }

    public void setGoodsState(Integer goodsState) {
        this.goodsState = goodsState;
    }

    public Integer getAddTime() {
        return addTime;
    }

    public void setAddTime(Integer addTime) {
        this.addTime = addTime;
    }

    public Integer getSellerTime() {
        return sellerTime;
    }

    public void setSellerTime(Integer sellerTime) {
        this.sellerTime = sellerTime;
    }

    public Integer getAdminTime() {
        return adminTime;
    }

    public void setAdminTime(Integer adminTime) {
        this.adminTime = adminTime;
    }

    public Integer getReasonId() {
        return reasonId;
    }

    public void setReasonId(Integer reasonId) {
        this.reasonId = reasonId;
    }

    public String getReasonInfo() {
        return reasonInfo;
    }

    public void setReasonInfo(String reasonInfo) {
        this.reasonInfo = reasonInfo == null ? null : reasonInfo.trim();
    }

    public String getPicInfo() {
        return picInfo;
    }

    public void setPicInfo(String picInfo) {
        this.picInfo = picInfo == null ? null : picInfo.trim();
    }

    public String getBuyerMessage() {
        return buyerMessage;
    }

    public void setBuyerMessage(String buyerMessage) {
        this.buyerMessage = buyerMessage == null ? null : buyerMessage.trim();
    }

    public String getSellerMessage() {
        return sellerMessage;
    }

    public void setSellerMessage(String sellerMessage) {
        this.sellerMessage = sellerMessage == null ? null : sellerMessage.trim();
    }

    public String getAdminMessage() {
        return adminMessage;
    }

    public void setAdminMessage(String adminMessage) {
        this.adminMessage = adminMessage == null ? null : adminMessage.trim();
    }


    public String getInvoiceNo() {
        return invoiceNo;
    }

    public void setInvoiceNo(String invoiceNo) {
        this.invoiceNo = invoiceNo == null ? null : invoiceNo.trim();
    }

    public Integer getShipTime() {
        return shipTime;
    }

    public void setShipTime(Integer shipTime) {
        this.shipTime = shipTime;
    }

    public Integer getDelayTime() {
        return delayTime;
    }

    public void setDelayTime(Integer delayTime) {
        this.delayTime = delayTime;
    }

    public Integer getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Integer receiveTime) {
        this.receiveTime = receiveTime;
    }

    public String getReceiveMessage() {
        return receiveMessage;
    }

    public void setReceiveMessage(String receiveMessage) {
        this.receiveMessage = receiveMessage == null ? null : receiveMessage.trim();
    }

    public Short getCommisRate() {
        return commisRate;
    }

    public void setCommisRate(Short commisRate) {
        this.commisRate = commisRate;
    }

    public void init() {
        setRefundSn(SerialNumGenerator.getOrderSn(SerialNumGenerator.ORDERCH_PC).toString());
        setGoodsId(0);
        setOrderGoodsId(0);
        setOrderGoodsType(1);
        setRefundType(1);
        setSellerState(SellerStateEnum.PROCESSED.getValue());
        setRefundState(1);
        setReturnType(1);
        setOrderLock(2);
        setGoodsState(1);
        setGoodsName("");
    }

    public String getAddTimeStr() {
        return addTimeStr;
    }

    public void setAddTimeStr(String addTimeStr) {
        this.addTimeStr = addTimeStr;
    }

    public Integer getExpressId() {
        return expressId;
    }

    public void setExpressId(Integer expressId) {
        this.expressId = expressId;
    }

}